package com.team5.controller;

import com.team5.entity.CashFlow;
import com.team5.entity.News;
import com.team5.response.Code;
import com.team5.response.Result;
import com.team5.service.CashFlowService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RequestMapping("/cashFlow")
@RestController
public class CashFlowController {
    @Autowired
    private CashFlowService service;
    @RequestMapping("/findById")
    public Result findByID(int id){
        CashFlow cashFlow = service.findById(id);
        return new Result(Code.SELECT_OK,cashFlow);
    }
    @RequestMapping("/findAll")
    public Result findAll(){
        CashFlow[] cashFlows = service.findAll();
        return new Result(Code.SELECT_OK,cashFlows);
    }
}
